
<div class="titlebar">
    <div class="fn-left"><i class="iconfont icon-line-chart_icon"></i> 商家储值</div>
    <div class="fn-right">
        <form class="input-group" id="form" action="{:url('store.card/index',['types' =>$types])}">
            <input placeholder="开始时间" class="input w100 ui-date" type="text" name="starttime" readonly autocomplete="false" value="{$starttime}"/>
            <input placeholder="结束时间" class="input w100 ui-date" type="text" name="endtime" readonly autocomplete="false" value="{$endtime}"/>
            <input type="submit" value="搜索" class="button button-blue" />
        </form>
    </div>
    <div class="fn-right button-group">
        <a href="{:url('store.card/index',['time' => 1,'types'=>$types])}" class="button {$time==1?'button-violet':''}">今日</a>
        <a href="{:url('store.card/index',['time' => 2,'types'=>$types])}" class="button {$time==2?'button-violet':''}">昨日</a>
        <a href="{:url('store.card/index',['time' => 30,'types'=>$types])}" class="button {$time==30?'button-violet':''}"">本月</a>
        <a href="{:url('store.card/index',['time' => 60,'types'=>$types])}" class="button {$time==60?'button-violet':''}"">上月</a>
    </div>
</div>
<div id="actionbar">
    <div class="fn-left">
        <a href="javascript:;" url="{:url('store.card/edit')}" class="button button-blue chickWin"> <i class="iconfont icon-add_icon"></i>创建储值</a>
    </div>
    <div class="fn-right ">
        <form id="form" action="{:url('store.card/index',['types'=>$types])}" method="get" class="input-group">
            <input placeholder="请输入会员卡名称" class="input w200" type="text" name="keyword" value="{$keyword}" />
            <input type="submit" value="搜索" class="button button-blue" />
        </form>
    </div>
    <div class="fn-right button-group">
        <a href="{:url('store.card/index',['types'=>0])}" class="button{if $types == 0} button-green{/if}">正常</a>
        <a href="{:url('store.card/index',['types'=>1])}" class="button{if $types == 1} button-green{/if}">锁定</a>
        <a href="{:url('store.card/index',['types'=>2])}" class="button{if $types == 2} button-green{/if}">回收站</a>
    </div>
</div>
<table class="table table-border">
    <thead>
        <tr>
            <th>活动名称</th>
            <th>主优惠券</th>
            <th class="w80 fn-tac">状态</th>
            <th class="w100 fn-tar">支付(￥)</th>
            <th class="w140 fn-tac">创建时间</th>
            <th class="w220 fn-tac">操作</th>
        </tr>
    </thead>
    <tbody>
        {foreach $lists as $vo}
        <tr>
            <td>
                <sapn class="fn-cp fn-fb chickWin" url="{:url('store.card/user',['store_id'=>$vo.store.id])}">{$vo.name}</sapn> <br />
                <i class="iconfont icon-store_icon"></i> <sapn class="fn-cp chickWin" url="{:url('store/review',['id'=>$vo.store.id])}">{$vo.store.name}</sapn> <br />
            </td>
            <td><sapn class="fn-cp chickWin" url="{:url('coupon/review',['id'=>$vo.coupon_id])}">{$vo.coupon.name}</sapn></td>
            <td class="fn-tac"><a class="istop" url="{:url('store.card/islock',['id'=>$vo.id])}" href="javascript:;">{if $vo.is_lock}<span class="badge bg-blue">正常</span>{else}<span class="badge">锁定</span>{/if}</a></td>
            <td class="fn-tar">￥{$vo.price|money}</td>
            <td class="fn-tac">{$vo.create_time|date='Y-m-d H:i'}</td>
            <td class="fn-tac button-group">
                {if $vo.is_end}
                    <a class="button button-disabled" href="javascript:;"><i class="iconfont icon-edit"></i>优惠券</a>
                    <a class="button button-disabled" href="javascript:;"><i class="iconfont icon-edit"></i>编辑</a>
                    <a class="button button-disabled">删除</a>
                {else}
                    <a class="button button-green chickWin" href="javascript:;" url="{:url('store.card/coupon',['id'=>$vo.id])}" title="优惠券"><i class="iconfont icon-edit"></i>优惠券</a>
                    <a class="button chickWin" href="javascript:;" url="{:url('store.card/edit',['id'=>$vo.id])}" title="编辑"><i class="iconfont icon-edit"></i>编辑</a>
                    <a class="button isDel" url="{:url('store.card/delete',['id'=>$vo.id])}" href="javascript:;" title="删除">删除</a>
                {/if}

            </td>
        </tr>
        {/foreach}
    </tbody>
</table>
{$lists|raw}
<script type="text/javascript">
Do('base','form','layer','tip','date', function () {
    $('#form').isForm({types:1});
    $('.isDel').isDel();
    $('.istop').actUrl()
    $(".chickWin").win({reload:1});
})
</script>